# def wrapper(f):
#     def inner(*args,**kwargs):
#         if f.__name__ == 'qq':
#
#             ret = f(*args,**kwargs)
#             return ret
#         else:
#
#     return inner


# def wrapper(f):
#     def inner(*args, **kwargs):
#         ret = f(*args, **kwargs)
#         return ret
#     return inner

# def wrapper_out(n,*args,sex='男',):
#     def wrapper(f):  # f
#         def inner(*args,**kwargs):
#             ret = f(*args,**kwargs)  # func1()
#             return ret
#         return inner
#     return wrapper
#
# def func1():
#     print('in func1')
# func = wrapper_out(1)  # wrapper函数名
# ly = func(func1)  # wrapper(func1) = inner
# ly()  # inner()

#
# def wrapper_out(n):
#     def wrapper(f):
#         def inner(*args,**kwargs):
#             # if n == 'qq':
#             #     username = input('请输入用户名：').strip()
#             #     password = input('请输入密码：').strip()
#             #     with open('qq',encoding='utf-8') as f1:
#             #         for line in f1:
#             #             user,pwd = line.strip().split('|')
#             #             if username == user and password == pwd:
#             #                 print('登陆成功')
#             #                 ret = f(*args,**kwargs)
#             #                 return ret
#             #         return False
#             # elif n == 'tiktok':
#             #     username = input('请输入用户名：').strip()
#             #     password = input('请输入密码：').strip()
#             #     with open('tiktok', encoding='utf-8') as f1:
#             #         for line in f1:
#             #             user, pwd = line.strip().split('|')
#             #             if username == user and password == pwd:
#             #                 print('登陆成功')
#             #                 ret = f(*args, **kwargs)
#             #                 return ret
#             #         return False
#             username = input('请输入用户名：').strip()
#             password = input('请输入密码：').strip()
#             with open(n,encoding='utf-8') as f1:
#                 for line in f1:
#                     user,pwd = line.strip().split('|')
#                     if username == user and password == pwd:
#                         print('登陆成功')
#                         ret = f(*args,**kwargs)
#                         return ret
#                 return False
#         return inner
#     return wrapper
# """
# # @wrapper_out('qq')
# # def qq():
# #     print('成功访问qq')
# # qq()
# # 看到带参数的装饰器分两步执行：
# '''
# @wrapper_out('腾讯')
#     1. 执行wrapper_out('腾讯') 这个函数，把相应的参数'腾讯' 传给 n,并且得到返回值 wrapper函数名。
#     2. 将@与wrapper结合，得到我们之前熟悉的标准版的装饰器按照装饰器的执行流程执行。
# '''
# """
#
#
# @wrapper_out('qq')
# def qq():
#     print('成功访问qq')
#
#
# @wrapper_out('tiktok')
# def tiktok():
#     print('成功访问抖音')
#
# qq()
# tiktok()
# 开发思路：增强耦合性